package modelo;

import titiritero.Posicionable;

public class Coordenada implements Posicionable {

	private int x, y;

	public Coordenada(){
		this.x = 0;
		this.y = 0;
	}
	
	public Coordenada(int coordX, int coordY){
		this.x = coordX;
		this.y = coordY;
	}
	
	public Coordenada(Coordenada coord){
		this.x = coord.getX();
		this.y = coord.getY();
	}
	
	public void setCoordenadas(int coordX, int coordY){
		this.x = coordX;
		this.y = coordY;
	}
	
	public void moverCoordenadas(int deltaX, int deltaY) {
		this.x += deltaX;
		this.y += deltaY;
	}
	
	public boolean equals (Coordenada coord){
		if (coord==null) return false;
		return (((coord.getX()) == this.x)&&((coord.getY()) == this.y));
	}
	
	public int getX(){
		return this.x;
	}
	
	public int getY(){
		return this.y;
	}
	
	public String toString() {
		return "( "+this.x+" , "+this.y+" )";
	}
	
}